<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>购买</title>
</head>

<body>
    <script>
        var yue = prompt("请输入购买月份");
        yue = Number(yue);
        if (Boolean(yue) && yue <= 12) {
            if (yue >= 5 && yue <= 10) {
                var ca = prompt("头等舱还是经济舱 请输入");
                if (ca == "头等舱") {
                    console.log(2000);
                }
                else if(ca == "经济舱"){
                    console.log(800);
                }else{
                   alert("请正确选择");
                }
            }
            else {
                var ca = prompt("头等舱还是经济舱 请输入");
                if (ca == "头等舱") {
                    console.log(800);
                }
                else if(ca == "经济舱"){
                    console.log(200);
                }else{
                   alert("请正确选择");
                }
            }
        }
        else {
            alert("请输入有效数字");
        }
    </script>
</body>

</html>